from django import forms

from .models import Comments


class EmailPost(forms.Form):
    name = forms.CharField(max_length=25)
    email = forms.EmailField()
    to = forms.EmailField()
    comments = forms.CharField(widget=forms.Textarea, required=False)


class CommentForm(forms.ModelForm):
    class Meta:
        model = Comments
        fields = ('name', 'email', 'body', 'activate')


class SearchForm(forms.Form):
    query = forms.CharField(max_length=250, label='搜索')